import os

def create(filename):
    # 去除首位空格
    filename = filename.strip()
    # 去除尾部 \ 符号
    filename = filename.rstrip("\\")
    list = ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20']
    #判断路径是否存在
    isExists=os.path.exists(filename)
    # 判断结果
    print(1)
    if not isExists:
        folder = os.makedirs(filename)
        output = os.path.dirname(filename)
        print(output)
        return True
    else:
        # 如果目录存,则创建新目录
        for i in list:
            isExists2 = os.path.exists(filename + i)
            if not isExists2:














                os.makedirs(filename + i)
                print(3)
                return False
            else:
                print(i)
                print(4)


create(filename="C:/Users/LXL/Desktop/路径")
